<html>
  <head>
    <title>Testing html-json library</title>
  </head>
  <script src="jsolait/jsolait.js"></script>
  <script>

var serviceURL = "json_sample.yaws";
var methods = [ "test1" ];

var jsonrpc = imprt("jsonrpc");
var service = new jsonrpc.ServiceProxy(serviceURL, methods);

function test() {
    try {
     foo = document.getElementById('foo').value;
     bar = document.getElementById('bar').value;
     document.getElementById('result').innerHTML = 
       "<PRE>" + service.test1(foo, bar) + "</PRE>";
     } catch(e) {
	alert(e);
     } 
     return false;
}

  </script>
  <body>
    <form action="" method="post" onSubmit="return test()">
      <div id="result">
      </div>
      <p>
	First Argument:  <input id="foo" />
      </p>
      <p>
	Second Argument: <input id="bar"/>
      </p>
      <p>
	<input type="submit" value="Do JSON-RPC call"/>
      </p>
    </form>
  </body>
</html>
